<?php
// +----------------------------------------------------------------------
// | ZanPianCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.zanpian.com All rights reserved.
// +----------------------------------------------------------------------
// | BBS:  <http://www.feifeicms.cc>
// +----------------------------------------------------------------------
namespace app\common\model;
use think\Model;
class Nav extends Model{
	protected $name = 'Usernav';
    // 定义时间戳字段名
    protected $createTime = '';
    protected $updateTime = '';
	// 自动完成
	protected $auto = [];
	protected $insert = [];
	protected $update = [];	
	//自动获取VodIsendTextAttr
    public function getCidTextAttr($value,$data){
        $serialize = [1=>'网站前台',2=>'会员中心'];
        return $serialize[$data['cid']];
    }	
    public function nav_cache(){
	    $list = db('Usernav')->order('oid asc')->select();
		foreach($list as $v){
				$navlist[$v['cid']][]=$v;       
	    }
		F('_user/nav_index',$navlist[1]); 
        F('_user/nav_center',$navlist[2]);	   
	}	
}